<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">工程负责人预收款信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程负责人</td><td id="gofuer" class="tv"></td><td class="tt">工程负责人联系电话</td><td id="gofutel" class="tv"></td></tr>
                </tbody>
            </table>
        </div>
<!--        <div class="table-box tablenes">-->
<!--            <div class="title">工程负责人预收款资金池（单位：元）</div>-->
<!--            <table class="layui-table">-->
<!--                <tbody>-->
<!--                <tr><td class="tt">累计预收款</td><td id="hougongyumoney" class="tv"></td><td class="tt">累计已收取</td><td id="hougongyukoufee" class="tv"></td></tr>-->
<!--                <tr><td class="tt">累计工程付款</td><td id="hougongzhimoneyqugoer" class="tv"></td><td class="tt">进项抵扣退税转入</td><td id="hougongshuimoneygoquan" class="tv"></td></tr>-->
<!--                <tr><td class="tt">预收款可用余额</td><td id="hougongyukeyong" class="tv" colspan="3"></td></tr>-->
<!--                </tbody>-->
<!--            </table>-->
<!--        </div>-->


        <div class="table-box tablenes">
            <div class="title">本次预收款到账信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">款项摘要</td><td id="zhai" class="tv"></td><td class="tt">到账金额(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">收款对象</td><td class="tv" id="duier" colspan="3"></td></tr>
                <tr><td class="tt"> 到账方式</td><td id="incdaotype_name" class="tv"></td><td class="tt">到账账户</td><td id="accid_name" class="tv"></td></tr>
                <tr><td class="tt">到账日期</td><td id="dt" class="tv"></td><td class="tt">通知业务员</td><td id="tonger_name" class="tv"></td></tr>
                <tr><td class="tt">用途说明</td><td class="tv" id="yong" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">收取信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">本次回款是否收取</td><td class="tv" id="iskou" colspan="3"></td></tr>
                <tr class="layui-hide iskouinfo"><td class="tt">本次收取款项类型</td><td id="koulei_name" class="tv"></td><td class="tt">本次收取合计</td><td id="koufee" class="tv"></td></tr>
                </tbody>
            </table>
        </div>


        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>


        <div class="table-box tablenes layui-hide fuwu_list">
            <script type="text/html" id="toolbarDemo_fuwu_list">收取明细-待收取劳务分包服务费</script>
            <div class="tableShow">
                <table id="fuwu_list" lay-filter="fuwu_list"></table>
            </div>
        </div>

        <div class="table-box tablenes layui-hide shuifei_list">
            <script type="text/html" id="toolbarDemo_shuifei_list">收取明细-待收取税款保证金(含利息)</script>
            <div class="tableShow">
                <table id="shuifei_list" lay-filter="shuifei_list"></table>
            </div>
        </div>

        <div class="table-box tablenes layui-hide gongjie_list">
            <script type="text/html" id="toolbarDemo_gongjie_list">收取明细-待收取工程负责人借款(含利息)</script>
            <div class="tableShow">
                <table id="gongjie_list" lay-filter="gongjie_list"></table>
            </div>
        </div>

        <div class="table-box tablenes layui-hide kuaifei_list">
            <script type="text/html" id="toolbarDemo_kuaifei_list">收取明细-待收取快递费</script>
            <div class="tableShow">
                <table id="kuaifei_list" lay-filter="kuaifei_list"></table>
            </div>
        </div>

        <div class="table-box tablenes layui-hide qifei_list">
            <script type="text/html" id="toolbarDemo_qifei_list">收取明细-直接收取</script>
            <div class="tableShow">
                <table id="qifei_list" lay-filter="qifei_list"></table>
            </div>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_hou_gongyu_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var account = res.data.account;



                if(account){
                    $('#accid_name').text(account.name+'('+account.accnum+')').click(function () {
                        openPage('../account/show.php?id='+account.id);
                    });
                }

                if(data.gofuer){
                    $("#gofuer").text(data.gofuer);
                    $('#hougongyumoney').text(data.hougongyumoney);
                    $('#hougongyukoufee').text(data.hougongyukoufee);
                    $('#hougongzhimoneyqugoer').text(data.hougongzhimoneyqugoer);
                    $('#hougongshuimoneygoquan').text(data.hougongshuimoneygoquan);
                    $('#hougongyukeyong').text(data.hougongyukeyong);
                }


                $("#gofutel").text(data.gofutel);
                $("#duier").text(data.duier);
                $("#zhai").text(data.zhai);
                $("#money").text(parseFormatNum(data.money));
                $("#incdaotype_name").text(data.incdaotype_name);
                $("#dt").text(data.dt);
                $("#tonger_name").text(data.tonger_name);
                $("#yong").text(data.yong);
                $("#iskou").text(data.iskou);
                $("#explain").text(data.explain);
                // $(".pageshowtitle").text('工程负责人预收款');





                if(data.iskou == '是'){
                    $(".iskouinfo").removeClass('layui-hide');
                    $("#koulei_name").text(data.koulei_name);
                    $("#koufee").text(parseFormatNum(data.koufee));

                    if(in_array('fuwu', data.kouleiArr)){
                        $(".fuwu_list").removeClass('layui-hide');

                        var fuwu_list_List = table.render({
                            elem: "#fuwu_list",data:res.data.fuwu_list, toolbar: '#toolbarDemo_fuwu_list', page: false
                            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                            , cols: [[
                                {type:'numbers',title:'序号'}
                                ,{field: 'houkoulei_name', title: '款项类型'}
                                ,{field: 'name', title: '费用所属工程名称'}
                                ,{field:'koufee',title:'本次收取(元)',templet: function(d){
                                        return parseFormatNum(d.koufee);
                                    }}
                                ,{field: 'kouxing', title: '收取性质'}
                                ,{field: 'shoubiao', title: '收取标准'}
                                ,{field: 'explain', title: '款项说明'}
                                ,{field: 'shimoney', title: '合同价(元)',templet: function(d){
                                        return parseFormatNum(d.shimoney);
                                    }}
                                ,{field: 'shijiemoney', title: '工程结算金额(元)',templet: function(d){
                                        return parseFormatNum(d.shijiemoney);
                                    }}
                                ,{field: 'ratefu', title: '劳务分包服务费率(%)'}
                                ,{field: 'yingkoufee', title: '累计应收取(元)',templet: function(d){
                                        return parseFormatNum(d.yingkoufee);
                                    }}
                                ,{field: 'yikoufee', title: '累计已收取(元)',templet: function(d){
                                        return parseFormatNum(d.yikoufee);
                                    }}
                                ,{field: 'daikoufee', title: '待收取(元)',templet: function(d){
                                        return parseFormatNum(d.daikoufee);
                                    }}
                            ]]
                            , done: function (res) {
                                soulTable.render(this);
                            }
                        });
                    }

                    if(in_array('shuifei', data.kouleiArr)){
                        $(".shuifei_list").removeClass('layui-hide');

                        var shuifei_list_List = table.render({
                            elem: "#shuifei_list",data:res.data.shuifei_list, toolbar: '#toolbarDemo_shuifei_list', page: false
                            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                            , cols: [[
                                {type:'numbers',title:'序号'}
                                ,{field: 'houkoulei_name', title: '款项类型'}
                                ,{field: 'enginname', title: '费用所属工程名称'}
                                ,{field: 'koufee', title: '本次收取(元)',templet: function(d){
                                        return parseFormatNum(d.koufee);
                                    }}
                                ,{field: 'kouxing', title: '收取性质'}
                                ,{field: 'shoubiao', title: '收取标准'}
                                ,{field: 'explain', title: '款项说明'}
                                ,{field: 'name', title: '税款保证金承诺书名称'}
                                ,{field: 'shendt', title: '申请日期'}
                                ,{field: 'xiaofee', title: '销项票开票金额(元)',templet: function(d){
                                        return parseFormatNum(d.xiaofee);
                                    }}
                                ,{field: 'dt', title: '开票日期'}
                                ,{field: 'baofee', title: '税款保证金金额(元)',templet: function(d){
                                        return parseFormatNum(d.baofee);
                                    }}
                            ]]
                            , done: function (res) {
                                soulTable.render(this);
                            }
                        });
                    }

                    if(in_array('gongjie', data.kouleiArr)){
                        $(".gongjie_list").removeClass('layui-hide');

                        var gongjie_list_List = table.render({
                            elem: "#gongjie_list",data:res.data.gongjie_list, toolbar: '#toolbarDemo_gongjie_list', page: false
                            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                            , cols: [[
                                {type:'numbers',title:'序号'}
                                ,{field: 'houkoulei_name', title: '款项类型'}
                                ,{field: 'youfee', title: '利息优惠(元)',templet: function(d){return parseFormatNum(d.youfee);}}
                                ,{field: 'kouben', title: '本次收取本金(元)',templet: function(d){return parseFormatNum(d.kouben);}}
                                ,{field: 'kouli', title: '本次收取利息(元)',templet: function(d){return parseFormatNum(d.kouli);}}
                                ,{field: 'koufee', title: '本次收取合计(元)',templet: function(d){return parseFormatNum(d.koufee);}}
                                ,{field: 'kouxing', title: '收取性质'}
                                ,{field: 'shoubiao', title: '收取标准'}
                                ,{field: 'explain', title: '款项说明'}
                                ,{field: 'number', title: '合同编号'}
                                ,{field: 'chuer', title: '出借方'}
                                ,{field: 'money', title: '放款到账金额(元)',templet: function(d){return parseFormatNum(d.money);}}
                                ,{field: 'daodt', title: '放款日期'}
                            ]]
                            , done: function (res) {
                                soulTable.render(this);
                            }
                        });
                    }

                    if(in_array('kuaifei', data.kouleiArr)){
                        $(".kuaifei_list").removeClass('layui-hide');

                        var kuaifei_list_List = table.render({
                            elem: "#kuaifei_list",data:res.data.kuaifei_list, toolbar: '#toolbarDemo_kuaifei_list', page: false
                            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                            , cols: [[
                                {type:'numbers',title:'序号'}
                                ,{field: 'houkoulei_name', title: '款项类型'}
                                ,{field: 'enginname', title: '费用所属工程名称'}
                                ,{field: 'koufee', title: '本次收取(元)',templet: function(d){
                                        return parseFormatNum(d.koufee);
                                    }}
                                ,{field: 'kouxing', title: '收取性质'}
                                ,{field: 'shoubiao', title: '收取标准'}
                                ,{field: 'explain', title: '款项说明'}
                                ,{field: 'kuailei', title: '收寄类型'}
                                ,{field: 'yunnum', title: '运单号'}
                                ,{field: 'kuaidt', title: '收寄日期'}
                                ,{field: 'futype', title: '付款方式'}
                                ,{field: 'kuaifee', title: '快递费用(元)',templet: function(d){
                                        return parseFormatNum(d.kuaifee);
                                    }}
                            ]]
                            , done: function (res) {
                                soulTable.render(this);
                            }
                        });
                    }

                    if(in_array('qifei', data.kouleiArr)){
                        $(".qifei_list").removeClass('layui-hide');

                        var qifei_list_List = table.render({
                            elem: "#qifei_list",data:res.data.qifei_list, toolbar: '#toolbarDemo_qifei_list', page: false
                            ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                            ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                            ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                            , cols: [[
                                {type:'numbers',title:'序号'}
                                ,{field: 'houkoulei_name', title: '款项类型'}
                                ,{field: 'enginname', title: '费用所属工程名称'}
                                ,{field: 'koufee', title: '本次收取(元)',templet: function(d){
                                        return parseFormatNum(d.koufee);
                                    }}
                                ,{field: 'kouxing', title: '收取性质'}
                                ,{field: 'shoubiao', title: '收取标准'}
                                ,{field: 'explain', title: '款项说明'}
                            ]]
                            , done: function (res) {
                                soulTable.render(this);
                            }
                        });
                    }
                }







                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('hou_gongyu', param_id);
    });



</script>
</body>
</html>




